home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 23 / AACD 23.iso / AACD / Online / opennap / client_quit.c < prev    next >
C/C++ Source or Header  |  2001-06-08  |  855b  |  35 lines

  1. /* Copyright (C) 2000-1 drscholl@users.sourceforge.net
  2.    This is free software distributed under the terms of the
  3.    GNU Public License.  See the file COPYING for details.
  4.  
  5.    $Id: client_quit.c,v 1.15 2001/02/15 08:39:45 drscholl Exp $ */
  6.  
  7. #include "opennap.h"
  8. #include "debug.h"
  9.  
  10. /* handle notification that a user has quit */
  11. /* <user> */
  12. HANDLER (client_quit)
  13. {
  14.     USER *user;
  15.  
  16.     (void) tag;
  17.     (void) len;
  18.     ASSERT (validate_connection (con));
  19.     CHECK_SERVER_CLASS ("client_quit");
  20.     user = hash_lookup (Users, pkt);
  21.     if (!user)
  22.     {
  23.     log ("client_quit: can't find user %s", pkt);
  24.     return;
  25.     }
  26.     ASSERT (validate_user (user));
  27.     if (ISSERVER (user->con))
  28.     {
  29.     pass_message_args (con, tag, "%s", user->nick);
  30.     hash_remove (Users, user->nick);
  31.     }
  32.     else
  33.     log ("client_quit: recieved QUIT for local user %s!", user->nick);
  34. }
  35.